package code.ws_common_utils
{
	/**
	 * url加载地址全局对象 
	 * @author qiangchen
	 * 
	 */	
	public class UrlUtils
	{
		/** 根路径 */
		public static var _roots:String = "";
		
		
		/**
		 * 获取主配置地址 
		 * @return 
		 * 
		 */		
		public static function get mainConfig():String
		{
			return _roots + "assets/config/config.xml";
		}
		
		/**
		 * 获取地图cm数据文件地址 
		 * @param mapId
		 * @param cmName
		 * @return 
		 * 
		 */		
		public static function getMapCmUrl( mapId:String, cmName:String ):String
		{
			return _roots + "assets/map/" + mapId + "/" + cmName + ".cm";
		}
		
		
		/**
		 * 获取用于处理原始地图的微版地图地址
		 * @param mapId 地图id
		 * @return 
		 * 
		 */		
		public static function getMicroMapUrl( mapId:String ):String
		{
			return _roots + "assets/map/" + mapId + "/s_" + mapId + ".jpg";
		}
		
		/**
		 * 获取地图原图地址
		 * @param mapId 地图id
		 * @return 
		 * 
		 */	
		public static function getOriginalMapUrl( mapId:String ):String
		{
			return _roots + "assets/map/" + mapId + "/b_" + mapId + ".jpg";
		}
		
		
		/**
		 * 获取英雄模型文件地址 
		 * @param key	模型文件名
		 * @return 
		 * 
		 */		
		public static function getHerolUrl( key:String ):String
		{
			return _roots + "assets/mode/hero/"  +  key + ".swf";
		}
		
		
		/**
		 * 获取怪物模型文件地址 
		 * @param key
		 * @return 
		 * 
		 */		
		public static function getMonsterUrl( key:String ):String
		{
			return _roots + "assets/mode/monster/" + key + ".swf";
		}
		
		/**
		 * 获取特效文件地址 
		 * @param key
		 * @return 
		 * 
		 */		
		public static function getEftUrl( key:String ):String
		{
			return _roots + "assets/eft/" + key + ".swf";
		}
		
		/**
		 * 获取ui资源纹理文件加载地址 
		 * @return 
		 * 
		 */		
		public static function get guiUrl():Array
		{
			var uiTexture:String = _roots + "assets/res/ui/ui.png";
			var uiTextureXml:String = _roots + "assets/res/ui/ui.xml";
			return [uiTexture, uiTextureXml];
		}
		
		/**
		 * 获取其他资源文件地址 
		 * @param fileName 文件名
		 * @param type 文件类型 ( 例如：png、jpg、gif等)
		 * @return 
		 * 
		 */		
		public static function getOtherResUrl( fileName:String, type:String ):String
		{
			return _roots + "assets/res/other/" + fileName + "." + type;	
		}
	}
}